package com.xuecheng.manage_course.client;

import com.xuecheng.framework.client.XcServiceList;
import com.xuecheng.framework.domain.cms.CmsPage;
import com.xuecheng.framework.domain.cms.response.CmsPageResult;
import jdk.nashorn.internal.objects.annotations.Getter;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author: gongfy
 * @create: 2020/8/13 10:10
 * @Description: csmpage客户端 Feign会通过动态代理生成实现类， @FeignClient 声明这是一个Feign客户端，类似@Mapper注解。同时通过value属性指定服务名称
 */
@FeignClient(name = XcServiceList.XC_SERVICE_MANAGE_CMS) // 指定远程调用的服务名
public interface CmsPageClient {
    //远程调用cms，根据页面id查询页面信息
    @GetMapping("/cms/page/get/{pageId}")
    public CmsPage findCmsPageById(@PathVariable(name = "pageId") String pageId);
    //远程调用cms，根据页面id查询页面信息
    @PostMapping("/cms/page/save")
    public CmsPageResult savePage(@RequestBody CmsPage cmsPage);
}
